package com.hsgene.product.persistence;

import com.hsgene.product.condition.PackageCondition;
import com.hsgene.product.domain.GeneticTestingPackage;
import com.hsgene.product.dto.GeneticTestingPackageDto;
import com.hsgene.product.dto.peanut.GeneticTestingPackageKeywordPeanutDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GeneticTestingPackageRepository {

    int insertPackage( GeneticTestingPackage geneticTestingPackage);

    int deleteByPrimaryKey(String id);

    GeneticTestingPackage selectByPrimaryKey(String id);

    int updateByPrimaryKey(GeneticTestingPackage record);

    GeneticTestingPackage getByPackageName(String packageName);

    int updateUsed(String id);

    int getListCount(@Param("condition") PackageCondition condition);

    List<GeneticTestingPackageDto> getList(@Param("condition") PackageCondition condition);

    void deletePackageById(String id);

    List<GeneticTestingPackageKeywordPeanutDto> getByKeyword(@Param("keyword") String keyword);

    int getPeanueCount(@Param("condition") PackageCondition condition);

    List<GeneticTestingPackageKeywordPeanutDto> getByKeywordPage(@Param("condition") PackageCondition condition);

    /**
     * 批量删除套餐
     * @param list
     */
    void deletePackageByIds(@Param("list") List<GeneticTestingPackageDto> list);
    /***
     *查询套餐对外的id倒排最大的一个
     * @author FX
     * @date 2018/12/13 17:51
     * @param
     * @return
     */
    String selectOrderByCode();
    /**
     *根据ids获取套餐
     * @author FX
     * @date 2018/12/20 13:57
     * @param ids
     * @return
     */
    List<GeneticTestingPackage> getByPackageIds(List<String> ids);
    /**
     *套餐更新为被使用（批量）
     * @author FX
     * @date 2018/12/20 14:12
     * @param collect
     * @return
     */
    void updateUsedMore(@Param("list") List<String> collect);
}